package com.hulk.dryad.activiti7.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.hulk.dryad.persistence.entity.DefinitionId;
import com.hulk.dryad.persistence.entity.ProcessDefinitionModel;

import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 *  流程定义处理
 *
 * @author hulk
 * @date 2020-10-18 17:18:42
 */
public interface IProcessDefinitionService {

    /**
     * 获取流程定义集合
     * @param processDefinitionModel
     * @return Page 分页信息
     */
    public Page<ProcessDefinitionModel> getProcessDefinitionPage(Page page, ProcessDefinitionModel processDefinitionModel);

	/**
	 * 获取流程部署信息
	 * @param instanceId
	 * @return DefinitionId
	 */
    public DefinitionId getDefinitionByInstanceId(String instanceId);

    /**
     * 删除流程定义
     * @param id
     * @return
     */
    public void removeProcessDefinitionById(String id);

    /**
     * 上传并部署流程定义
     * @param file
     * @return
     * @throws IOException
     */
    public void uploadStreamAndDeployment(MultipartFile file,String deploymentName) throws IOException;

    /**
     * 启动挂起流程流程定义
     * @param id 流程定义id
     * @param suspendState 流程状态
     * @return
     */
    public void suspendOrActiveApply(String id, Integer suspendState);

    /**
     * 上传流程流程定义
     * @param multipartFile
     * @return
     */
    public String upload(MultipartFile multipartFile) throws IOException;

    /**
     * 通过stringBPMN添加流程定义
     * @param stringBPMN
     * @return
     */
    public void addDeploymentByString(String stringBPMN ,String deploymentName);

    /**
     * 获取流程定义XML
     * @param response
     * @param deploymentId
     * @param resourceName
     */
    public void getProcessDefineXML(HttpServletResponse response, String deploymentId,String resourceName) throws IOException;
}
